<?php

namespace app\exam\validate;

use think\Validate;

class Goods extends Validate
{
    protected $rule = [
        'good_name' => 'require',
        'good_id' => 'require',
        'good_type' => 'require',
        'good_brand' => 'require',
        'good_stock' => 'require',
        'good_price' => 'require',
        'good_img' => 'require',
        'g_way' => 'require',
        'g_cacy' => 'require',
        'news' => 'require',
        'bests' => 'require',
    ];
    protected $message = [
        'good_name.require' => '商品名称不能为空',
        'good_id.require' => '商品编号不能为空',
        'good_type.require' => '商品分类不能为空',
        'good_brand.require' => '商品品牌不能为空',
        'good_stock.require' => '商品库存不能为空',
        'good_price.require' => '商品价格不能为空',
        'good_img.require' => '商品图片不能为空',

        'g_way.require' => '是否上架不能为空',
        'g_cacy.require' => '是否精品不能为空',
        'news.require' => '是否新品不能为空',
        'bests.require' => '是否热销不能为空',

    ];
    protected $scene = [
        'goods' => ['good_name', 'good_id',
            'good_type', 'good_brand',
            'good_stock',
            'good_price', 'good_img',
            'g_way','g_cacy','news','bests'
            ]
    ];
}
